home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Python 1.1 / configure.in < prev    next >
Encoding:
Text File  |  1994-10-11  |  7.2 KB  |  270 lines  |  [TEXT/R*ch]

  1. dnl Process this file with autoconf 1.8 or later to make a configure script.
  2. AC_REVISION(1.8)dnl
  3. AC_PREREQ(1.8)dnl
  4. AC_INIT(Include/object.h)
  5. AC_CONFIG_HEADER(config.h)dnl
  6. # Don't suppress compiler output when --verbose is specified
  7. test -n "$verbose" &&
  8.     ac_compile=`echo "$ac_compile" | sed "s|>/dev/null 2>&1||"`
  9. AC_VERBOSE(setting ac_compile to '$ac_compile')
  10.  
  11. # checks for alternative programs
  12. AC_CHECKING(for --with(out)-gcc)
  13. AC_WITH(gcc, [
  14.     case $withval in
  15.     no)    withval=cc;;
  16.     yes)    withval=gcc;;
  17.     esac
  18.     CC=$withval])
  19. AC_PROG_CC
  20. AC_PROG_RANLIB
  21. AC_SUBST(AR)
  22. AC_PROGRAMS_CHECK(AR, ar aal, ar)
  23. AC_SUBST(INSTALL)
  24. # Install just never works :-(
  25. if test -z "$INSTALL"
  26. then INSTALL=cp
  27. fi
  28. AC_SUBST(OPT)
  29. # Optimizer/debugger flags passed between Makefiles
  30. if test -z "$OPT"
  31. then OPT=-O
  32. fi
  33.  
  34. # checks for UNIX variants that set C preprocessor variables
  35. AC_AIX
  36. AC_ISC_POSIX
  37. AC_MINIX
  38. dnl DYNIX test runs compile so must be last
  39. AC_DYNIX_SEQ
  40. AC_CHECKING(for NeXT)
  41. AC_TEST_PROGRAM([
  42. #ifdef _NEXT_SOURCE
  43. main() { exit(0); }
  44. #endif
  45. ], AC_DEFINE(_POSIX_SOURCE))
  46.  
  47. # checks for header files
  48. AC_STDC_HEADERS
  49. AC_HAVE_HEADERS(dlfcn.h fcntl.h limits.h signal.h stdarg.h stdlib.h thread.h unistd.h utime.h sys/audioio.h sys/param.h sys/select.h sys/time.h sys/times.h sys/un.h sys/utsname.h)
  50. AC_DIR_HEADER
  51.  
  52. # checks for typedefs
  53. AC_CHECKING(for clock_t in time.h)
  54. AC_HEADER_EGREP(clock_t, time.h, , AC_DEFINE(clock_t, long))
  55. AC_MODE_T
  56. AC_OFF_T
  57. AC_PID_T
  58. AC_RETSIGTYPE
  59. AC_SIZE_T
  60. AC_UID_T
  61.  
  62. # Set name for machine-dependent library files
  63. AC_SUBST(MACHDEP)
  64. if test -z "$MACHDEP"
  65. then
  66.     ac_system=`uname -s | tr '[[A-Z]]' '[[a-z]]'`
  67.     ac_release=`uname -r | sed 's/\..*//'`
  68.     MACHDEP="$ac_system$ac_release"
  69.     case MACHDEP in
  70.     '')    MACHDEP=unknown;;
  71.     esac
  72.     AC_VERBOSE(setting MACHDEP to '$MACHDEP')
  73. fi
  74.  
  75. # Set info about shared libraries.
  76. # XXX This should try things out instead of testing uname!
  77. AC_SUBST(SO)
  78. AC_SUBST(LDSHARED)
  79. AC_SUBST(CCSHARED)
  80. AC_SUBST(LINKFORSHARED)
  81. ac_system=`uname -s`
  82. ac_release=`uname -r`
  83. # SO is the extension of shared libraries `(including the dot!)
  84. # -- usually .so, .sl on HP-UX
  85. if test -z "$SO"
  86. then
  87.     case $ac_system in
  88.     hp*|HP*) SO=.sl;;
  89.     *)    SO=.so;;
  90.     esac
  91.     AC_VERBOSE(setting SO to '$SO')
  92. fi
  93. # LDSHARED is the ld *command* used to create shared library
  94. # -- "ld" on SunOS 4.x.x, "ld -G" on SunOS 5.x, "ld -shared" on IRIX 5
  95. if test -z "$LDSHARED"
  96. then
  97.     case $ac_system/$ac_release in
  98.     IRIX*) LDSHARED="ld -shared";;
  99.     SunOS/4*) LDSHARED="ld";;
  100.     SunOS/5*) LDSHARED="ld -G";;
  101.     hp*|HP*) LDSHARED="ld -b";;
  102.     *)    LDSHARED="ld";;
  103.     esac
  104.     AC_VERBOSE(setting LDSHARED= to '$LDSHARED')
  105. fi
  106. # CCSHARED are the C *flags* used to create objects to go into a shared
  107. # library -- this is only needed for HP-UX
  108. if test -z "$CCSHARED"
  109. then
  110.     case $ac_system in
  111.     hp*|HP*) CCSHARED="+z";;
  112.     esac
  113.     AC_VERBOSE(setting CCSHARED= to '$CCSHARED')
  114. fi
  115. # LINKFORSHARED are the flags passed to the $(CC) command that links
  116. # the python executable -- this is only needed for HP-UX
  117. if test -z "$LINKFORSHARED"
  118. then
  119.     case $ac_system in
  120.     hp*|HP*) LINKFORSHARED="-Wl,-E";;
  121.     esac
  122.     AC_VERBOSE(setting LINKFORSHARED to '$LINKFORSHARED')
  123. fi
  124.  
  125. # checks for libraries
  126. AC_HAVE_LIBRARY(dl)
  127.  
  128. AC_CHECKING(for --with-svr4)
  129. AC_WITH(svr4, [
  130. AC_HAVE_LIBRARY(socket)
  131. AC_HAVE_LIBRARY(inet)
  132. AC_HAVE_LIBRARY(nsl)
  133. ])
  134.  
  135. AC_CHECKING(for --with-readline)
  136. AC_WITH(readline, [AC_DEFINE(WITH_READLINE)
  137. if test ! -d "$withval"
  138. then AC_ERROR(proper usage is --with-readline=DIRECTORY)
  139. fi
  140. termcap=
  141. AC_HAVE_LIBRARY(termcap, [termcap=termcap], [AC_HAVE_LIBRARY(termlib, [termcap=termlib])])
  142. if test ! -z "$termcap"
  143. then LIBS="$LIBS $withval/libreadline.a"
  144.      # Avoid possible conflict between shared libraries termcap and gl
  145.      # on IRIX 5: both contain a routine called clear.
  146.      if test -f /usr/lib/lib$termcap.a
  147.      then LIBS="$LIBS /usr/lib/lib$termcap.a"
  148.      else LIBS="$LIBS -l$termcap"
  149.      fi
  150. else AC_ERROR(no working termcap/termlib, do not use --with-readline)
  151. fi])
  152.  
  153. AC_CHECKING(for --with-thread)
  154. AC_WITH(thread, [
  155. if test -d "$withval"
  156. then LIBS="$LIBS -L$withval"
  157. fi
  158. AC_HAVE_LIBRARY(pthreads, [AC_DEFINE(WITH_THREAD)
  159. AC_DEFINE(_POSIX_THREADS)
  160. LIBS="$LIBS -lpthreads"
  161. LIBOBJS="$LIBOBJS thread.o"])
  162. AC_HAVE_LIBRARY(mpc, [AC_DEFINE(WITH_THREAD)
  163. LIBS="$LIBS -lmpc"
  164. LIBOBJS="$LIBOBJS thread.o"])
  165. AC_HAVE_LIBRARY(thread, [AC_DEFINE(WITH_THREAD)
  166. LIBS="$LIBS -lthread"
  167. LIBOBJS="$LIBOBJS thread.o"])
  168. ])
  169.  
  170. # -I${DLINCLDIR} is added to the compile rule for import.o
  171. AC_SUBST(DLINCLDIR)
  172. DLINCLDIR=/
  173.  
  174. AC_CHECKING(for --with-sgi-dl)
  175. AC_WITH(sgi-dl, [AC_DEFINE(WITH_SGI_DL)
  176. dldir=$withval
  177. if test -d "$dldir"
  178. then LIBS="$LIBS -L$dldir"
  179. else AC_ERROR(proper usage is --with-sgi-dl=DIRECTORY)
  180. fi
  181. DLINCLDIR=${dldir}
  182. LIBS="$LIBS -ldl -lmld"])
  183.  
  184. AC_CHECKING(for --with-dl-dld)
  185. AC_WITH(dl-dld, [AC_DEFINE(WITH_DL_DLD)
  186. dldir=`echo "$withval" | sed 's/,.*//'`
  187. dlddir=`echo "$withval" | sed 's/.*,//'`
  188. if test -d "$dldir" -a -d "$dlddir"
  189. then LIBS="$LIBS -L$dldir -L$dlddir"
  190. else AC_ERROR(proper usage is --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY)
  191. fi
  192. DLINCLDIR=${dldir}
  193. LIBS="$LIBS -ldl -ldld"])
  194.  
  195. # checks for library functions
  196. AC_HAVE_FUNCS(chown clock dlopen ftime gettimeofday getpeername getpgrp getpid getwd link lstat nice readlink select setgid setuid setsid setpgid setpgrp setvbuf siginterrupt symlink tcgetpgrp tcsetpgrp times uname waitpid)
  197. AC_REPLACE_FUNCS(dup2 getcwd strerror memmove)
  198. AC_FUNC_CHECK(getpgrp, AC_COMPILE_CHECK([argument to getpgrp], [#include <unistd.h>], [getpgrp(0);], AC_DEFINE(GETPGRP_HAVE_ARG)))
  199.  
  200. # checks for structures
  201. AC_TIME_WITH_SYS_TIME
  202. AC_STRUCT_TM
  203. AC_TIMEZONE
  204. AC_COMPILE_CHECK([whether we have altzone], [#include <time.h>], [return altzone;], AC_DEFINE(HAVE_ALTZONE))
  205. AC_COMPILE_CHECK([whether sys/select.h and sys/time.h may both be included], [
  206. #include <sys/types.h>
  207. #include <sys/select.h>
  208. #include <sys/time.h>
  209. ], [;], [AC_DEFINE(SYS_SELECT_WITH_SYS_TIME)])
  210.  
  211. # checks for compiler characteristics
  212.  
  213. AC_CHAR_UNSIGNED
  214.  
  215. AC_CONST
  216.  
  217. AC_COMPILE_CHECK([lack of working volatile],[],[volatile int x; x = 0;],,AC_DEFINE(volatile,))
  218.  
  219. AC_COMPILE_CHECK([lack of working signed char], [], [signed char c;],,AC_DEFINE(signed, []))
  220.  
  221. AC_CHECKING(for prototypes)
  222. AC_TEST_PROGRAM([
  223. int foo(int x) { return 0; }
  224. int main() { return foo(10); }
  225. ], AC_DEFINE(HAVE_PROTOTYPES) have_prototypes=1)
  226.  
  227. AC_CHECKING(for variable length prototypes and stdarg.h)
  228. AC_TEST_PROGRAM([
  229. #include <stdarg.h>
  230. int foo(int x, ...) { return 0; }
  231. int main() { return foo(10, 11, 12); }
  232. ], AC_DEFINE(HAVE_STDARG_PROTOTYPES) have_prototypes=1)
  233. if test "$have_prototypes"; then
  234. AC_COMPILE_CHECK(["bad exec* prototypes"], [#include <unistd.h>], [char **t;execve("@",t,t);], , AC_DEFINE(BAD_EXEC_PROTOTYPES))
  235. fi
  236.  
  237. AC_CHECKING(for bad static forward)
  238. AC_TEST_PROGRAM([
  239. struct s { int a; int b; };
  240. static struct s foo;
  241. int foobar() { return !foo.a; }
  242. static struct s foo = { 1, 2 };
  243. main() { exit(foobar()); }
  244. ], , AC_DEFINE(BAD_STATIC_FORWARD))
  245.  
  246. # checks for system services
  247. # (none yet)
  248.  
  249. # other checks for UNIX variants
  250. AC_IRIX_SUN
  251. AC_XENIX_DIR
  252.  
  253. # check for --with-libm=...
  254. AC_SUBST(LIBM)
  255. LIBM=-lm
  256. AC_WITH(libm, [if test "$withval" != yes
  257. then LIBM=$withval
  258. else AC_ERROR(proper usage is --with-libm=STRING)
  259. fi])
  260.  
  261. # check for --with-libc=...
  262. AC_SUBST(LIBC)
  263. AC_WITH(libc, [if test "$withval" != yes
  264. then LIBC=$withval
  265. else AC_ERROR(proper usage is --with-libc=STRING)
  266. fi])
  267.  
  268. # generate output files
  269. AC_OUTPUT(Makefile Objects/Makefile Parser/Makefile Python/Makefile Modules/Makefile.pre)
  270.